#ifndef DEVICECONTROLDIALOG_H
#define DEVICECONTROLDIALOG_H

#include "selectgroupdialog.h"
#include "clientcenter.h"
#include "common.h"
#include "datacenter.h"
#include "clientcenter.h"
#include "singleclient.h"
#include "switchctrl.h"
#include "NetworkCommonFunction.h"
#include "QTimer"
#include "QMessageBox"
#include "clientgroupcenter.h"
#include "clientgroup.h"

#include "childwindowbase.h"

namespace Ui {
    class DeviceControlDialog;
}

class DeviceControlDialog : public ChildWindowBase
{
    Q_OBJECT

public:
	explicit DeviceControlDialog(ChildWindowBase *parent = 0);
    ~DeviceControlDialog();

private:
    Ui::DeviceControlDialog *ui;

protected:
	void changeEvent(QEvent *e);
	void showGroupView(int groupId);

private:
	void setupSignal();
	void setupWidget();
	SelectGroupDialog* m_SelectGroupDialog;
	QTimer *timer;
	QMessageBox *message;
	void onSendSwitchCtrl(int deviceNo,bool deviceSwitch);
	void showMessage();
	std::vector<boost::shared_ptr<ClientGroup> > m_GroupList;
	void initialDialog();

private slots:
	void onSwitchOn1();
	void onSwitchOn2();
	void onSwitchOn3();
	void onSwitchOn4();
	void onSwitchOn5();
	void onSwitchOn6();

	void onSwitchOff1();
	void onSwitchOff2();
	void onSwitchOff3();
	void onSwitchOff4();
	void onSwitchOff5();
	void onSwitchOff6();

	void onLock1();
	void onLock2();
	void onLock3();
	void onLock4();
	void onLock5();
	void onLock6();

	void onSetClient();
	void onSelectGroupDlg();
	void closeMessageBox();
};

#endif // DEVICECONTROLDIALOG_H
